package edu.pitt.myptm;

public class MyCommand implements Comparable{
	public final static int READ = 0;
	public final static int WRITE = 1;
	public final static int MATCH = 2;
	public final static int DELETE = 3;
	public final static int BEGIN = 8;
	public final static int COMMIT = 9;
	public final static int ABORT = 10;
	
	private int timestamp;
	public int getTimeStamp() {
		return timestamp;
	}
	
	public void setTimeStamp(int timestamp) {
		this.timestamp = timestamp;
	}

	int type = 0;		
	
	public int getType() {
		return type;
	}
	
	int transactionId;
	public int getTransactionId() {
		return transactionId;
	}
	public void setTransactionId(int transactionId) {
		this.transactionId  = transactionId;
	}
	
	public int getId() {
		return -1;
	}
	
	public void setId(int id) {
		
	}
	public boolean isTransaction() {
		return true;
	}
	
	public void setFilename(String filename) {
		
	}
	public boolean isBeginCommand() {
		return false;
	}
	
	public boolean isCommitCommand() {
		return false;
	}
	
	public boolean isAbortCommand() {
		return false;
	}
	
	public boolean isReadCommand() {
		return false;
	}
	public boolean isMatchCommand() {
		return false;
	}
	
	public boolean isWriteCommand() {
		return false;
	}
	public boolean isDeleteCommand() {
		return false;
	}
	
	public String getFilename() {
		return null;
	}
	
	public DataItem getDataItem() {
		return null;
	}

	public String getAreacode() {
		return null;
	}

	@Override
	public int compareTo(Object arg0) {
		// TODO Auto-generated method stub
		return this.getTimeStamp()-((MyCommand)arg0).getTimeStamp();
	}
}
